Add backup_manager client resources#137
Open
BenjaminPelletier wants to merge 1 commit intoRopeWiki:masterfrom
Open
Add backup_manager client resources#137BenjaminPelletier wants to merge 1 commit intoRopeWiki:masterfrom
BenjaminPelletier wants to merge 1 commit intoRopeWiki:masterfrom
Conversation
Contributor
Just for reference, in case you haven't seen them, this is how I've been collecting & pruning backups for a while now: Client #!/bin/bash
set -euo pipefail
# backup container changes key every restart, so StrictHostKeyChecking=no
SSH="ssh -o StrictHostKeyChecking=no -i ~admin/.ssh/id_hcooper_ropewiki_ed25519_230509 -p 22001"
DST="/volume3/b2_backblaze_backups/ropewiki"
rsync --partial --progress -e "$SSH" -avz backupreader@app.ropewiki.com:~/backups/* $DST/db/
$SSH backupreader@app.ropewiki.com "touch ~/backups/last_offsite_copy_db_coops"
rsync --partial --progress -avz -L -e "$SSH" --exclude 'BALLAST_DELETE_IF_OUT_OF_SPACE' --exclude 'lost+found' backupreader@app.ropewiki.com:~/images/* $DST/images/
$SSH backupreader@app.ropewiki.com "touch ~/backups/last_offsite_copy_images_coops"Server (/rw/mount/sqlbackup/prune_backups.sh) #!/bin/bash
# This looks at the modification date of `last_offsite_copy_db_coops`, and deletes any backups X days older than that.
# `last_offsite_copy_db_coops` is updated by Coops' offsite rsync script.
find /rw/mount/sqlbackup -type f -name "*.sql.zst" ! -newermt "@$(($(stat -c %Y /rw/mount/sqlbackup/last_offsite_copy_db_coops) - (3 * 24 * 60 * 60) ))" -exec rm {} \; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR adds a few tools to help clients of backup_manager, and in particular, a cloud backup server I'm spinning up. Suggestions for better ways to do things welcome :)